package com.bdi.mqtt_broker.constant;

import java.util.regex.Pattern;

/**
 * @author WangNing yogehaoren@gmial.com <br>
 * @since 1.0
 * 全局魔法字符串
 */
public class Constants {

    /**
     * channel 中存储的 MQTT client ID
     */
    public static String CHANNEL_ATTRIBUTE_CLIENT_ID = "_client_id";

    /**
     * MQTT client 连接 session Redis 前缀
     */
    public static String SESSION_CACHE_PRE = "weshare_iot_mqtt:session:";

    /**
     * MQTT client 未使用通配符订阅 Redis 前缀
     */
    public static String SUB_WITHOUT_WILDCARD_CACHE_PRE = "weshare_iot_mqtt:subnotwildcard:";

    /**
     * MQTT client 使用通配符订阅 Redis 前缀
     */
    public static String SUB_WITH_WILDCARD_CACHE_PRE = "weshare_iot_mqtt:subwildcard:";

    /**
     * MQTT client 订阅列表
     */
    public static String SUB_CLIENT_CACHE_PRE = "weshare_iot_mqtt:client:";

    /**
     * 配置文件环境变量注入 Pattern
     */
    public static Pattern ENVIRONMENT_PATTERN = Pattern.compile("\\$\\{(.*)\\}");

}
